package cn.joker.controller;


import cn.joker.constant.PageQuery;
import cn.joker.constant.PageResult;
import cn.joker.constant.Result;
import cn.joker.entity.po.Systems;
import cn.joker.services.ISystemsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 接入的系统应用表 前端控制器
 * </p>
 *
 * @author joker
 * @since 2025-04-29
 */
@RestController
@RequestMapping("/systems")
@Api(tags = "项目管理")
public class SystemsController {
    @Autowired
    private ISystemsService systemsService;

    @PostMapping("/addSystemInfo")
    @ApiOperation("新增项目")
    public Result<String> addSystemInfo(@RequestBody Systems systems) {
        systemsService.addSystemInfo(systems);
        return Result.success("新增成功");
    }

    @PostMapping("/getSystemList")
    @ApiOperation("获取项目集合")
    public Result<PageResult<Systems>> getSystemList(@RequestBody PageQuery query) {
        return systemsService.getSystemList(query);
    }

    @PostMapping("/deleteSystemByCode")
    @ApiOperation("获取项目集合")
    public Result<String> deleteSystemByCode(@RequestBody Systems systems) {
        return systemsService.deleteSystemByCode(systems);
    }
}
